"""
	The Help module defines a class for creating a help frame window.
	The code for this class is partly derived from an online tutorial from
	the website www.zetcode.com (section about Advanced widgets).
	
	@author: T.L. Siaw
	@organization: University of Twente
"""

# ==================== Importing external libraries

import wx, os
import wx.html as html

class HelpWindow(wx.Frame):
    """
        A frame window showing the help documentation.
    """

    def __init__(self, parent, id, title, path):
        """
            Constructor of HelpWindow: creating the frame window with help info.

            @param parent: The parent window of this frame window.
            @param id: The id given to this window.
            @param title: The title of this window.
            @param path: The path of the directory to extract files from.
        """

        wx.Frame.__init__(self, parent, id, title, size = (570, 400))
        self.SetIcon(parent.GetIcon())

        self.panel = wx.Panel(self, -1)

        vbox2 = wx.BoxSizer(wx.VERTICAL)

        help = html.HtmlWindow(self.panel, -1, style = wx.NO_BORDER)
        help.LoadPage(os.path.join(path, "res/manual.html"))
        vbox2.Add(help, 1, wx.EXPAND)
        self.panel.SetSizer(vbox2)

        self.Centre()
        self.Show(True)
